#ifndef __M_CONFIG_H__
#define __M_CONFIG_H__

#define SETTING_CONFIG_VERSION 1

#define DATA_DIR "ur0:data"
#define CONFIG_DIR DATA_DIR "/TurboPad"

enum ConfigErrorCode
{
	CONFIG_ERROR_CODE_NO_ERROR,
	CONFIG_ERROR_CODE_LOAD_OK,
	CONFIG_ERROR_CODE_LOAD_ERROR,
	CONFIG_ERROR_CODE_SAVE_OK,
	CONFIG_ERROR_CODE_SAVE_ERROR,
};
enum ConfigTypes
{
	CONFIG_TYPE_CURRENT,
	CONFIG_TYPE_DEFAULT,
};

typedef struct SettingConfig
{
	int32_t version;
	int32_t enable_turbo;
	int32_t button_left;
	int32_t button_up;
	int32_t button_right;
	int32_t button_down;
	int32_t button_cross;
	int32_t button_circle;
	int32_t button_square;
	int32_t button_triangle;
	int32_t button_select;
	int32_t button_start;
	int32_t button_l;
	int32_t button_r;
	int32_t button_l2;
	int32_t button_r2;
	int32_t button_l3;
	int32_t button_r3;
} SettingConfig;

int resetConfig();
int loadConfigEx(int type);
int saveConfigEx(int type);
int loadConfig();
int saveConfig();

extern SettingConfig setting_config;
extern const char *error_texts[];
extern int config_error_code;

#endif